#ifndef PROCESS_MAIN_H
#define PROCESS_MAIN_H

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <pthread.h>

#define CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
#define CONFIG_FEATURE_CLEAN_UP

#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
#include <time.h>
#include <sys/time.h>
#include <fcntl.h>
#include <netinet/in.h>  /* htons */
#endif

#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>

#define COMM_LEN 16
#include "sockio.h"



typedef struct {
	int sockfd;
	int interval;
} process_args_t;

typedef struct {
        int pid;
        char user[9];
        char state[4];
        unsigned long rss;
        int ppid;
#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
        unsigned pcpu;
        unsigned pscpu;
        unsigned long stime, utime;
#endif
        char *cmd;

        /* basename of executable file in call to exec(2),
                size from kernel headers */
        char short_cmd[COMM_LEN];
} procps_status_t;

//declare functions
void* process_main(void* );


#include <dirent.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
procps_status_t * procps_scan(int );

static void init_Hertz_value(void);
static void do_stats(void);
static void clearmems(void);
static void display_status(int , int );
static unsigned long display_generic();
static int  write_buf(char *start, int maxlength);
#endif
